﻿using System.Collections.Generic;

namespace PaceR.Core.Interfaces
{
    /// <summary>
    /// A collection of messages returned from an operation
    /// </summary>
    public interface IResultMessages
    {
        /// <summary>
        /// All messages
        /// </summary>
        IEnumerable<IResultMessage> AllMessages { get; set; }
        /// <summary>
        /// All messages of the Information type
        /// </summary>
        IEnumerable<IResultMessage> InformationMessages { get; }
        /// <summary>
        /// All messages of the Warning type
        /// </summary>
        IEnumerable<IResultMessage> WarningMessages { get; }
        /// <summary>
        /// All messages of the Error type
        /// </summary>
        IEnumerable<IResultMessage> ErrorMessages { get; }

        /// <summary>
        /// Merge messages from another result set
        /// </summary>
        /// <param name="resultMessages"></param>
        void MergeMessages(IResultMessages resultMessages);
        /// <summary>
        /// Add a message
        /// </summary>
        /// <param name="message">message to be added</param>
        void AddMessage(IResultMessage message);
        /// <summary>
        /// Add a message
        /// </summary>
        /// <param name="identifier">String to identify a message</param>
        /// <param name="message">message text</param>
        /// <param name="messageType">message type</param>
        void AddMessage(string identifier, string message, ResultMessageTypes messageType);
        /// <summary>
        /// Add and information message
        /// </summary>
        /// <param name="identifier">String to identify a message</param>
        /// <param name="message">Message text</param>
        void AddInformationMessage(string identifier, string message);
        /// <summary>
        /// Add a warning message
        /// </summary>
        /// <param name="identifier">String to identify a message</param>
        /// <param name="message">Message text</param>
        void AddWarningMessage(string identifier, string message);
        /// <summary>
        /// Add an error message
        /// </summary>
        /// <param name="identifier">String to identify a message</param>
        /// <param name="message">Message text</param>
        void AddErrorMessage(string identifier, string message);
    }
}
